<?
// [GajaxMethod]
function Login($usuario, $senha)
{
	$objAuth = new Autenticacao();	
	$login = $objAuth->Login($usuario, $senha);
	
	if ($login)
	{
		session_register("sLogin");
		$_SESSION["sLogin"] = $login;
	}
	
	return $login;
}

// [GajaxMethod]
function EstaLogado()
{
	if (isset($_SESSION["sLogin"]))
	{
		return ($_SESSION["sLogin"] != "" ? true : false);
	}
	else
	{
		return false;
	}
	
}

// [GajaxMethod]
function LerDadosUsuario()
{
	return $_SESSION["sLogin"];
}

// [GajaxMethod]
function Logout()
{
	$_SESSION["sLogin"] = "";
	session_destroy();
	return true;
}

gajax_export("Login", "EstaLogado", "LerDadosUsuario", "Logout");
gajax_handle_client_request();
gajax_show_javascript(true);
?>
<script language="javascript" src="scripts/include_menu_superior.js"></script>
<form action="verificarlogin.php" method="post" name="form1" target="_top" style="margin:0">
  <table width="779" border="0" cellspacing="0" cellpadding="0">
    <tr> 
      <td><img src="imagens/barra.jpg" width="779" height="94"></td>
    </tr>
    <tr> 
      <td background="imagens/mh_fundo.jpg"><table width="779" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td>&nbsp;</td>
            <td width="5"><img src="imagens/mh_canto_esquerdo.jpg" width="5" height="21"></td>
            <td width="120"><div align="center" class="texto"><a href="index.php" class="texto">HOME</a></div></td>
            <td width="5"><img src="imagens/mh_canto_direito.jpg" width="5" height="21"></td>
		<!-- laco para listar secoes -->
		<?
		$rows = $DB->GetActiveRecords("secoes", "tipo IN ('texto', 'contato') order by tipo desc, ordem");
		
		foreach ($rows as $row)
		{		
		?>
            <td width="5"><img src="imagens/mh_canto_esquerdo.jpg" width="5" height="21"></td>
            <td width="120"><div align="center" class="texto"><a href="conteudo.php?secao=<? echo $row->id; ?>" class="texto"><? echo strtoupper($row->nome); ?></a></div></td>
            <td width="5"><img src="imagens/mh_canto_direito.jpg" width="5" height="21"></td>
		<? 
		}
		?>
          </tr>
        </table></td>
    </tr>
  </table>
  <TABLE WIDTH=779 BORDER=0 CELLPADDING=0 CELLSPACING=0>
    <TR> 
      <TD width="182" class="bg-superior-escuro">&nbsp; </TD>
      <TD width="43" background="imagens/login_02.jpg" bgcolor="C1C7C7"> <IMG SRC="imagens/login_02.jpg" WIDTH=43 HEIGHT=23 ALT=""></TD>
      <TD valign="middle" class="bg-superior-claro">
	  <!-- divLogin starts here -->
	  <div id="divLogin" align="right"></div>
	  <!-- divLogin ends here -->
	  </TD>
    </TR>
  </TABLE>
</form>